package com.ctgu.server.dao.vo;


import com.ctgu.server.dao.constant.ResultEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@ApiModel(value = "Result", description = "")
@NoArgsConstructor
public class Result {
    @ApiModelProperty(value = "返回code,400为失败")
    private int code=200;
    @ApiModelProperty(value = "返回提示信息")
    private String message;
    @ApiModelProperty(value = "返回数据")
    private Object data=null;

    public Result(String message) {
        this.message = message;
    }

    public Result(String message, Object data) {
        this.message = message;
        this.data = data;
    }

    public Result(int code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }
    public Result(ResultEnum resultEnum) {
        this.code = resultEnum.code;
        this.message = resultEnum.msg;
    }
    public Result(ResultEnum resultEnum, Object data) {
        this.code = resultEnum.code;
        this.message = resultEnum.msg;
        this.data = data;
    }

}
